package com.miao.im.repository;

import com.miao.im.service.message.ChatMessage;
import com.miao.im.service.message.OfflineMessageCounter;
import reactor.core.publisher.Mono;

import java.util.Map;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/5/19 20:37
 * @Description:
 */
public interface IMessageRepository {
    /**
     * @Description: 新增一条离线消息
     * @Author: miaoguoxin
     * @Date: 2021/5/19
     */
    Mono<Void> reactiveAddOfflineMsg(ChatMessage chatMessage);

    /**
     * @Description: 添加一条离线消息计数
     * @Author: miaoguoxin
     * @Date: 2021/5/19
     */
    Mono<Void> reactiveIncOfflineCounter(ChatMessage chatMessage);

    /**
     * @Description: 查询离线消息计数器
     * @Author: miaoguoxin
     * @Date: 2021/5/19
     */
    Map<String, OfflineMessageCounter> getMsgCounter(Long userId);
}
